package com.dingtalk.dingbotmgr.action;

import java.util.List;

import com.dingtalk.dingbotmgr.model.ChatBot;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

/**
 * Created by wyx on 2017/2/28.
 */
@Component("chatBotAction")
@Scope("prototype")
public class ChatBotAction extends BaseAction {

    private ChatBot chatBot;

    private List<ChatBot> chatBotList;

    public String listChatBot() {
        chatBotList = chatBotService.list();
        return SUCCESS;
    }

    public String saveChatBot() {
        chatBotService.saveOrUpdate(chatBot);
        return SUCCESS;
    }

    public String deleteChatBot() {
        chatBotService.delete(chatBot);
        return SUCCESS;
    }

    public ChatBot getChatBot() {
        return chatBot;
    }

    public void setChatBot(ChatBot chatBot) {
        this.chatBot = chatBot;
    }

    public List<ChatBot> getChatBotList() {
        return chatBotList;
    }

    public void setChatBotList(List<ChatBot> chatBotList) {
        this.chatBotList = chatBotList;
    }
}
